RTSP is an application-level protocol primarily for controlling transmission of real-time data. It provides an extensible framework for controlling and playing real-time data such as video data or audio data on demand. RTSP is designed to control multiple data transmission sessions, to provide a method for selecting a transmission channel, and to provide a method for selecting a transmission mechanism based on a Real Time Transport Protocol (RTP).
As shown in FIG. 1, an RTSP signaling interaction process in the prior art includes:
Step 101: A client sends a DESCRIBE request to the server, requesting presentation description from RTSP. The request carries the description of the media content and the identifier of each media stream. For example, the media content description includes the number of media streams in a media content, and the details about each media stream such as the media type and the coding/decoding type. The client is an RTSP client, and the server is an RTSP server.
Step 102: The server returns a success response (200 OK) to the client and describes the requested information.
The process of the client obtaining the resource description information is a completely independent process of obtaining information before the client requests media from the server and performs control operations for the media. The information may also be obtained by other means such as HTTP and email.
Step 103: The client sends a SETUP message to the server, requesting to set up a media stream. The message carries a media stream identifier that specifies the media stream to be set up, for example, an audio media stream or a video media stream in a multimedia content.
Step 104: The server returns a success response (200 OK) to the client, and the setup of the media stream is completed.
Step 103 and step 104 are a complete process of setting up a media stream. After completion of setting up the media stream, the server does not start playing the media or transmitting the media stream. To start the play, the client needs to send a PLAY message to the server explicitly, requesting to play the media. The multimedia content generally includes multiple media streams. To play multiple media, the client needs to set up multiple media streams with the server. In RTSP, each media stream desired by the client needs to be set up between the client and the server one by one; that is, the interaction process in step 103 or step 104 occurs repeatedly.
Step 105: The client sends a PLAY message to the server, requesting to start playing the media. The message carries a media stream identifier that specifies an established media stream to be played, or carries a presentation identifier that specifies play of all media streams in an established presentation package.
Step 106: The server returns a success response (200 OK) to the client in response to step 105, indicating start of playing the media stream.
The media stream is transmitted through a media channel.
Step 105 and step 106 constitute a process of setting up a media channel. After the interaction in step 105 and step 106 is completed, the client may receive the media stream from the server through the media channel, decode the received media stream and display the media stream to the user through a user terminal interface, or store the media stream locally.
In the media stream applications, the client requests the server to execute a request command, if a normal or abnormal event occurs when the server executes the command, the server needs to notify the event or the latest condition of executing the request to the client in certain mode. In the RTSP application, however, the server begins playing the requested media to the client after receiving a PLAY message, and returns a success response (200 OK) to the client at the same time. Afterward, if an exceptional event (for example, an exception of the server in reading the media file) in the process of playing the media, or a non-exceptional event (for example, in the real-time streaming application, the user requests fast-forward but the play progress has reached the program of the current time) that needs to be handled by the client occurs, because the prior RTSP protocol provides no relevant mechanism or technology, the server is unable to notify the exception or the event to the client. Consequently, the state is inconsistent between the client and the server, and the user experience is poor.